package com.hehao.consumer;

import com.rabbitmq.client.Channel;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer;
import org.springframework.amqp.rabbit.listener.adapter.MessageListenerAdapter;
import org.springframework.stereotype.Component;

import java.util.concurrent.CountDownLatch;

/**
 * 普通类型
 * @Author Damon
 * @Date 2024/7/30 9:39
 */
@Slf4j
@Component
public class Customer {

    @RabbitListener(queuesToDeclare = @Queue(value = "testQueue"))
    public void listener(String msg) throws InterruptedException {
        log.info("接收消息【普通模式】：{}", msg);
//         通过抛异常，验证消息重试
//        throw new RuntimeException("Err");
    }

}
